3.2.88 \(\int x \cot (a+i \log (x)) \, dx\) [188]

Optimal. Leaf size=35 \[ -\frac {i x^2}{2}-i e^{2 i a} \log \left (e^{2 i a}-x^2\right ) \]

[Out]

-1/2*I*x^2-I*exp(2*I*a)*ln(exp(2*I*a)-x^2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {4592, 456, 455, 45} \begin {gather*} -i e^{2 i a} \log \left (-x^2+e^{2 i a}\right )-\frac {i x^2}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*Cot[a + I*Log[x]],x]

[Out]

(-1/2*I)*x^2 - I*E^((2*I)*a)*Log[E^((2*I)*a) - x^2]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 455

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 456

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[x^(m + n*(p + q
))*(b + a/x^n)^p*(d + c/x^n)^q, x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[p, q] &&
NegQ[n]

Rule 4592

Int[Cot[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*((-I - I*E^(2*I*a*d)
*x^(2*I*b*d))/(1 - E^(2*I*a*d)*x^(2*I*b*d)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]

Rubi steps

\begin {align*} \int x \cot (a+i \log (x)) \, dx &=\int x \cot (a+i \log (x)) \, dx\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(118\) vs. \(2(35)=70\).
time = 0.02, size = 118, normalized size = 3.37 \begin {gather*} -\frac {i x^2}{2}-\text {ArcTan}\left (\frac {\left (-1+x^2\right ) \cos (a)}{-\sin (a)-x^2 \sin (a)}\right ) \cos (2 a)-\frac {1}{2} i \cos (2 a) \log \left (1+x^4-2 x^2 \cos (2 a)\right )-i \text {ArcTan}\left (\frac {\left (-1+x^2\right ) \cos (a)}{-\sin (a)-x^2 \sin (a)}\right ) \sin (2 a)+\frac {1}{2} \log \left (1+x^4-2 x^2 \cos (2 a)\right ) \sin (2 a) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*Cot[a + I*Log[x]],x]

[Out]

(-1/2*I)*x^2 - ArcTan[((-1 + x^2)*Cos[a])/(-Sin[a] - x^2*Sin[a])]*Cos[2*a] - (I/2)*Cos[2*a]*Log[1 + x^4 - 2*x^
2*Cos[2*a]] - I*ArcTan[((-1 + x^2)*Cos[a])/(-Sin[a] - x^2*Sin[a])]*Sin[2*a] + (Log[1 + x^4 - 2*x^2*Cos[2*a]]*S
in[2*a])/2

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 28, normalized size = 0.80

method result size
risch \(-\frac {i x^{2}}{2}-i {\mathrm e}^{2 i a} \ln \left ({\mathrm e}^{2 i a}-x^{2}\right )\) \(28\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cot(a+I*ln(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2*I*x^2-I*exp(2*I*a)*ln(exp(2*I*a)-x^2)

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 109 vs. \(2 (23) = 46\).
time = 0.27, size = 109, normalized size = 3.11 \begin {gather*} -\frac {1}{2} i \, x^{2} + {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) - {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right ) + \frac {1}{2} \, {\left (-i \, \cos \left (2 \, a\right ) + \sin \left (2 \, a\right )\right )} \log \left (x^{2} + 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) + \frac {1}{2} \, {\left (-i \, \cos \left (2 \, a\right ) + \sin \left (2 \, a\right )\right )} \log \left (x^{2} - 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cot(a+I*log(x)),x, algorithm="maxima")

[Out]

-1/2*I*x^2 + (cos(2*a) + I*sin(2*a))*arctan2(sin(a), x + cos(a)) - (cos(2*a) + I*sin(2*a))*arctan2(sin(a), x -
 cos(a)) + 1/2*(-I*cos(2*a) + sin(2*a))*log(x^2 + 2*x*cos(a) + cos(a)^2 + sin(a)^2) + 1/2*(-I*cos(2*a) + sin(2
*a))*log(x^2 - 2*x*cos(a) + cos(a)^2 + sin(a)^2)

________________________________________________________________________________________

Fricas [A]
time = 2.77, size = 23, normalized size = 0.66 \begin {gather*} -\frac {1}{2} i \, x^{2} - i \, e^{\left (2 i \, a\right )} \log \left (x^{2} - e^{\left (2 i \, a\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cot(a+I*log(x)),x, algorithm="fricas")

[Out]

-1/2*I*x^2 - I*e^(2*I*a)*log(x^2 - e^(2*I*a))

________________________________________________________________________________________

Sympy [A]
time = 0.11, size = 27, normalized size = 0.77 \begin {gather*} - \frac {i x^{2}}{2} - i e^{2 i a} \log {\left (x^{2} - e^{2 i a} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cot(a+I*ln(x)),x)

[Out]

-I*x**2/2 - I*exp(2*I*a)*log(x**2 - exp(2*I*a))

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 41, normalized size = 1.17 \begin {gather*} -\frac {1}{2} i \, x^{2} + \frac {1}{2} \, \pi e^{\left (2 i \, a\right )} - i \, e^{\left (2 i \, a\right )} \log \left (x + e^{\left (i \, a\right )}\right ) - i \, e^{\left (2 i \, a\right )} \log \left (-x + e^{\left (i \, a\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cot(a+I*log(x)),x, algorithm="giac")

[Out]

-1/2*I*x^2 + 1/2*pi*e^(2*I*a) - I*e^(2*I*a)*log(x + e^(I*a)) - I*e^(2*I*a)*log(-x + e^(I*a))

________________________________________________________________________________________

Mupad [B]
time = 2.20, size = 27, normalized size = 0.77 \begin {gather*} -\ln \left (x^2-{\mathrm {e}}^{a\,2{}\mathrm {i}}\right )\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,1{}\mathrm {i}-\frac {x^2\,1{}\mathrm {i}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cot(a + log(x)*1i),x)

[Out]

- log(x^2 - exp(a*2i))*exp(a*2i)*1i - (x^2*1i)/2

________________________________________________________________________________________